package com.java.demo.service;

import com.java.demo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

@Service
public class UserService {


    @Bean
    public User user1() {
        User user1 = new User();
        user1.setName("张三");
        return user1;
    }

    @Bean
    public User user2() {
        User user2 = new User();
        user2.setName("李四");
        return user2;
    }

    public void sayHi() {
        System.out.println("我是UserService");
    }

}
